﻿-- TABELA RESPONSÁVEL POR ARMAZENAR REGISTROS DE ACESSO AO GOOGLE GEOCODING SERVICE
CREATE TABLE [dbo].[GeocodingLog](
	[GeocodingLogId] [bigint] IDENTITY(1,1) NOT NULL,
	[NumberOfAccess] [bigint] NOT NULL,
	[DayOfUse] [datetime] NOT NULL,
	CONSTRAINT [PK_GeocodingLog] PRIMARY KEY CLUSTERED ([GeocodingLogId] ASC) ON [PRIMARY]
) ON [PRIMARY]
GO

-- TABELA RESPONSÁVEL POR ARMAZENAR OS DADOS DAS IMOBILIÁRIAS
CREATE TABLE [dbo].[RealEstateAgency](
	[RealEstateAgencyId] [bigint] IDENTITY(1,1) NOT NULL,
	[Name] [varchar](50) NOT NULL
	CONSTRAINT [PK_RealEstateAgency] PRIMARY KEY CLUSTERED ([RealEstateAgencyId] ASC) ON [PRIMARY]
) ON [PRIMARY]
GO

-- TABELA RESPONSÁVEL POR ARMAZENAR OS DADOS DOS IMÓVEL PARA ALUGUEL
CREATE TABLE [dbo].[Estate](
	[EstateId] [bigint] IDENTITY(1,1) NOT NULL,
	[Name] [varchar](50) NOT NULL,
	[Latitude] [decimal](9,6) NOT NULL,
	[Longitude] [decimal](9,6) NOT NULL,
	[InfoContent] [varchar](400) NOT NULL,
	[MarkerType] [int] NOT NULL,
	[MonthlyValue] [decimal](18, 2) NULL,
	[NumberOfRooms] [int] NULL,
	[AreaInSquareMeter] [int] NULL,
	[PropertyType] [int] NULL,
	[RealEstateAgencyId] [bigint] NULL
	CONSTRAINT [PK_Estate] PRIMARY KEY CLUSTERED ([EstateId] ASC) ON [PRIMARY]
) ON [PRIMARY]
GO